#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;

vector<int>arr = { 5,4,3,6,1,2 };

void bubblesort(int n){
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n - i - 1; j++) {
			if (arr[j] > arr[j + 1]) {
				swap(arr[j], arr[j + 1]);
			}
		}
	}
}
int main() {
	int length = arr.size();
	cout << "原先的顺序为：";
	for (int i = 0; i < length; i++) {
		cout << arr[i] << ' ';
	}
	cout << endl;
	bubblesort(length);
	cout << "排序后的顺序为：";
	for (int i = 0; i < length; i++) {
		cout << arr[i] << ' ';
	}
	return 0;
}
